<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="layout/template.xhtml">

    <ui:define name="body">

        <h:messages globalOnly="true" styleClass="message"/>

        <rich:panel>
            <f:facet name="header">traitList</f:facet>

            <div class="results">

                <h:outputText value="No trait exists"
                              rendered="#{empty traitList.resultList}"/>

                <h:dataTable id="traitList" var="trait"
                             value="#{traitList.resultList}"
                             rendered="#{not empty traitList.resultList}">
                    <h:column>
                        <f:facet name="header">Name</f:facet>
                        <s:link id="trait"
                                value="#{trait.name}"
                                view="/trait.xhtml">
                            <f:param name="traitId"
                                     value="#{trait.id}"/>
                        </s:link>
                    </h:column>
                    <h:column>
                        <f:facet name="header">Fails Expectations</f:facet>
                        #{trait.failsExpectations}
                    </h:column>
                    <h:column>
                        <f:facet name="header">Meets Expectations</f:facet>
                        #{trait.meetsExpectations}
                    </h:column>
                    <h:column>
                        <f:facet name="header">Exceeds Expectations</f:facet>
                        #{trait.exceedsExpectations}
                    </h:column>
                </h:dataTable>

            </div>

        </rich:panel>

        <div class="actionButtons">
            <s:button id="done"
                      value="Create trait"
                      view="/traitEdit.xhtml"/>
        </div>

    </ui:define>

</ui:composition>

